﻿@using Radzen
@using Microsoft.AspNetCore.Components.Forms
@inherits FormComponent<bool>
@if (Visible)
{
<div @ref="@Element" @attributes="Attributes" class="@GetCssClass()" id="@GetId()"
     @onclick="@Toggle" @onkeypress="@(async (args) => { if (args.Code == "Space") { await Toggle(); } })" style="outline: 0 none;@Style" tabindex="@(Disabled ? "-1" : $"{TabIndex}")">
    <div class="rz-helper-hidden-accessible">
        <input type="checkbox" name="@Name" id="@Name" checked="@Value" value="@ValueAsString" tabindex="-1">
    </div>
    <span class="rz-switch-circle@(Disabled ? " rz-disabled" : "")"></span>
</div>
}
